#!/usr/bin/env python
# coding=utf-8
import sys,httplib
import urllib2

conn = httplib.HTTPConnection('travel.globaldoctor.com.cn')
headers = {"Host":"travel.globaldoctor.com.cn",
           "User-Agent":"Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.9) Gecko/20100315 Firefox/3.5.9",
           "Accept":"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
           "Accept-Language":"en-us,en;q=0.5",
           "Accept-Encoding":"gzip,deflate",
           "Accept-Charset":"ISO-8859-1,utf-8;q=0.7,*;q=0.7",
           "Keep-Alive":"115",
           "Connection":"keep-alive",
           "Referer":"http://dujia.soulv.com/renbao/index.html",
           "Content-Type":"application/x-www-form-urlencoded"
           }
conn.request('GET', '/Application/Policy.aspx?campaignID=26&referredBy=74', "",headers)
result = conn.getresponse()
status = result.status
print "\nResponse: ", status
res = result.read()
#print res
print type(status)
if status==200:
    hit=urllib2.urlopen('http://log.soulv.com/oyesgoLog?method=doEdm&baseParam=ref:soulv_f,innerUrl:soulv,outerUrl:soulv,localUrl:http://renshou.soulv.com',None,120).read()
    print hit
conn.close()


